<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_sys_class('model', '', 0);
class signed_model extends model {
	public $table_name = '';
	public function __construct() {
		$this->db_config = pc_base::load_config('database');
		$this->db_setting = 'default';
		$this->table_name = 'signed';
		parent::__construct();
	}
	function get_owners_signed($userid){
		$sql = "select * from ".$this->table_name.' where userid='.$userid.' and is_sure = 0';
		$sql_count = "select count(*) as cnt from ".$this->table_name.' where userid='.$userid.' and is_sure = 0';
		$this->query($sql);
		$arr = $this->fetch_array();
		$this->query($sql_count);
		$count = $this->fetch_array();
		return array('data'=>$arr,'count'=>$count);
	}
	function get_company_signed($userid){
		$sql = "select * from ".$this->table_name.' where c_userid ='.$userid.' and is_sure = 0';
		$sql_count = "select count(*) as cnt from ".$this->table_name.' where c_userid ='.$userid.' and is_sure = 0';
		$this->query($sql);
		$arr = $this->fetch_array();
		$this->query($sql_count);
		$count = $this->fetch_array();
		return array('data'=>$arr,'count'=>$count);
	}
}
?>